package com.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mapper.ParkruleMapper;
import com.pojo.Parkrule;
import com.service.ParkruleService;
import com.vo.ParkruleVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ParkruleServiceimpl implements ParkruleService {
    @Resource
    private ParkruleMapper parkruleMapper;
    @Override
    public PageInfo<Parkrule> selectruleall(ParkruleVo parkruleVo) {
        PageHelper.startPage(parkruleVo.getPage(),parkruleVo.getLimit());
        List<Parkrule> selectruleall = parkruleMapper.selectruleall(parkruleVo);
        PageInfo<Parkrule> pageInfo=new PageInfo<>(selectruleall);
        return pageInfo;
    }

    @Override
    public int insertSelective(Parkrule record) {
        int i = parkruleMapper.insertSelective(record);
        return i;
    }
    @Override
    public List<Parkrule> selectAllParkRule() {
        List<Parkrule> parkrules = parkruleMapper.selecAllParkRule();
        return parkrules;
    }

    @Override
    public Parkrule selectParkRuleById(Integer id) {
        Parkrule parkrule = parkruleMapper.selectRuleById(id);
        return parkrule;
    }

    @Override
    public int updateByPrimaryKeySelective(Parkrule record) {
        int i = parkruleMapper.updateByPrimaryKeySelective(record);
        return i;
    }
}
